package com.lz.rocketmq.consumer.project.listener.broadcasting;

import com.lz.rocketmq.consumer.common.utils.DateUtils;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * @author Administrator
 */
@Service
@RocketMQMessageListener(consumerGroup = "t0",topic = "trade-topic",  messageModel = MessageModel.BROADCASTING)
public class ConsumerTradeT0cService implements RocketMQListener<String> {

    public static String t = null;
    @Override
    public void onMessage(String message) {
        System.out.println(String.format("日期: %s Service: %s group: %s topic: %s messageModel:%s msg:%s", DateUtils.getCurr_YYYY_MM_DD_HH_MM_SS_SSS(),"TradeT0c", "t0", "trade-topic", "广播", message));
    }
}